package org.springside.examples.showcase.wb.web;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springside.examples.showcase.wb.entity.WbSite;
import org.springside.examples.showcase.wb.service.WbSiteManager;

@Controller
@RequestMapping(value = "/wb/wbsite")
public class WbSiteController {

	@Autowired
	private WbSiteManager wbSiteManager;

	@RequestMapping(value = { "list", "" })
	public String list(Model model) {
		List<WbSite> wbSites = wbSiteManager.findByScreenName("非妮妮莫属");
		model.addAttribute("wbSites", wbSites);
		return "wb/wbSiteList";
	}
}
